package com.extrace.loader;

import android.app.Activity;
import android.util.Log;

import com.extrace.misc.model.TransNode;
import com.extrace.net.HttpAsyncTask;
import com.extrace.net.HttpResponseParam;
import com.extrace.net.IDataAdapter;
import com.extrace.ui.main.ExTraceApplication;

import java.util.List;

public class TransNodeEditLoader extends HttpAsyncTask {

    String url;
    IDataAdapter<List<TransNode>> adapter;
    private Activity context;

    public TransNodeEditLoader(IDataAdapter<List<TransNode>> adapter, Activity context) {
        super(context);
        this.context = context;
        this.adapter = adapter;
        url = ((ExTraceApplication)context.getApplication()).getMiscServiceUrl();
    }

    @Override
    public void onDataReceive(String class_name, String json_data) {

    }

    @Override
    public void onStatusNotify(HttpResponseParam.RETURN_STATUS status, String str_response) {
        Log.i("onStatusNotify", "onStatusNotify: " + str_response);
    }

    public void LoadTransNode(String id) {
        url += "getNode/" + id + "?_type=json";
        try {
            execute(url, "GET");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
